package com.wujie.hello.spring.cloud.alibaba.nacos.feign.consumer.service.impl;

import com.wujie.hello.spring.cloud.alibaba.nacos.feign.consumer.service.TestClient;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author wujie
 * @version 1.0.0:
 * @title TestServiceImpl
 * @Description TODO
 * @dateTime 2020/9/7 9:37
 * @Copyright 2020-2021
 */
@Component
public class TestClientImpl implements FallbackFactory<TestClient> {
    @Override
    public TestClient create(Throwable throwable) {
        return new TestClient() {
            @Override
            public String sayHi(String msg) {
                return "hi ,this is err!but you msg = "+msg+"! And you fail reason is "+throwable.getMessage();
            }
        };
    }
}
